﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace FooDest
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Home", // Route name
                "", // URL with parameters
                new { controller = "Home", action = "Index" } // Parameter defaults
            );

            routes.MapRoute(
                "Dia diem", // Route name
                "DiaDiem", // URL with parameters
                new { controller = "Home", action = "DiaDiem" } // Parameter defaults
            );

            routes.MapRoute(
                "Dia diem gan day", // Route name
                "GanDay", // URL with parameters
                new { controller = "Home", action = "GanDay" } // Parameter defaults
            );

            routes.MapRoute(
                "Chi tiet dia diem", // Route name
                "DiaDiem/ChiTiet/{id}", // URL with parameters
                new { controller = "Home", action = "ChiTiet", id = UrlParameter.Optional } // Parameter defaults
            );

            routes.MapRoute(
                "Them dia diem", // Route name
                "ThemDiaDiem", // URL with parameters
                new { controller = "Home", action = "ThemDiaDiem" } // Parameter defaults
            );

            routes.MapRoute(
                "Dang nhap", // Route name
                "DangNhap", // URL with parameters
                new { controller = "Home", action = "DangNhap" } // Parameter defaults
            );

            routes.MapRoute(
                "Thong tin thanh vien", // Route name
                "ThanhVien/{id}", // URL with parameters
                new { controller = "Home", action = "ThanhVien", id = UrlParameter.Optional } // Parameter defaults
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}", // URL with parameters
                new { controller = "Home", action = "Index" } // Parameter defaults
            );

            //routes.MapRoute(
            //    "Default", // Route name
            //    "{controller}/{action}/{id}", // URL with parameters
            //    new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            //);
        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }
    }
}